package net.xiduth.game.player.dialogues;

import net.xiduth.game.player.Skills;

public class XPBook extends Dialogue {

	@Override
	public void start() {
		stage = 1;
		sendOptionsDialogue("Select a Skill", "Dungeoneering Experience",
				"Summoning Experience", "Agility Experience",
				"Hunter Experience", "Runecrafting Experience");

	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == 1) {
			if (componentId == OPTION_1) {
				player.getSkills().addXp(Skills.DUNGEONEERING, 2500);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getPackets().sendGameMessage(
						"You gained Dungeoneering experience.");
				player.getInventory().deleteItem(22340, 1);
				player.getInventory().refresh();
			} else if (componentId == OPTION_2) {
				player.getSkills().addXp(Skills.SUMMONING, 2500);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getPackets().sendGameMessage(
						"You gained Summoning experience.");
				player.getInventory().deleteItem(22340, 1);
				player.getInventory().refresh();
			} else if (componentId == OPTION_3) {
				player.getSkills().addXp(16, 2500);
				player.getPackets().sendGameMessage(
						"You gained Agility experience.");
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInventory().deleteItem(22340, 1);
				player.getInventory().refresh();

			} else if (componentId == OPTION_4) {
				player.getSkills().addXp(21, 2500);
				player.getPackets().sendGameMessage(
						"You gained Hunter experience.");
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInventory().deleteItem(22340, 1);
				player.getInventory().refresh();

			} else if (componentId == OPTION_5) {
				player.getSkills().addXp(20, 2500);
				player.getInventory().deleteItem(22340, 1);
				player.getInventory().refresh();
				player.getPackets().sendGameMessage(
						"You gained Runecrafting experience.");
				player.getInterfaceManager().closeChatBoxInterface();
			}
		}
	}

	@Override
	public void finish() {
	}

}
